package com.vnp.cooking.bean;

import org.json.JSONException;
import org.json.JSONObject;

import android.os.Parcel;
import android.os.Parcelable;
import android.widget.ImageView;

public class ObjCachlam implements Parcelable{
	int step;
	String decriptionStep;
	String urlImageStep;
	String nameImage;
	
	
	public String getNameImage() {
		return nameImage;
	}
	public void setNameImage(String nameImage) {
		this.nameImage = nameImage;
	}
	public int getStep() {
		return step;
	}
	public void setStep(int step) {
		this.step = step;
	}
	public String getDecriptionStep() {
		return decriptionStep;
	}
	public void setDecriptionStep(String decriptionStep) {
		this.decriptionStep = decriptionStep;
	}
	public String getUrlImageStep() {
		return urlImageStep;
	}
	public void setUrlImageStep(String urlImageStep) {
		this.urlImageStep = urlImageStep;
	}
	
	public ObjCachlam() {
		super();
	}
	
	
	public ObjCachlam(String txtCachlam, String urlImagbuoclam, int thuTuBuoclam, String nameImage) {
		super();
		this.decriptionStep = txtCachlam;
		this.urlImageStep = urlImagbuoclam;
		this.step = thuTuBuoclam;
		this.nameImage = nameImage;
	}
	
	public JSONObject getJsonObject() {
		JSONObject obj = new JSONObject();
		try{
			obj.put("desc", decriptionStep);
			obj.put("image", nameImage);
			obj.put("index", step);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return obj;
	}
	
	public ObjCachlam(Parcel in) {
		step = in.readInt();
		decriptionStep = in.readString();
		urlImageStep = in.readString();
		nameImage = in.readString();
	}
	@Override
	public int describeContents() {
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flag) {
		dest.writeInt(step);
		dest.writeString(decriptionStep);
		dest.writeString(urlImageStep);
		dest.writeString(nameImage);
	}
	
	public static final Parcelable.Creator<ObjCachlam> CREATOR = new Parcelable.Creator<ObjCachlam>() {
		public ObjCachlam createFromParcel(Parcel in) {
			return new ObjCachlam(in);
		}

		public ObjCachlam[] newArray(int size) {
			return new ObjCachlam[size];
		}
	};

}
